/**
 * meta参数解析
 * hideLeft: 是否隐藏左侧菜单，单页菜单为true
 * module: 菜单所属模块
 * menu: 所属菜单，用于判断三级菜单是否显示高亮，如菜单列表、添加菜单、编辑菜单都是'menu'，用户列表、添加用户、编辑用户都是'user'，如此类推
 */
const routes = [{
  path: '/',
  component: resolve => require(['./components/Account/Login.vue'], resolve),
  name: 'Login'
}, {
  path: '/home',
  component: resolve => require(['./components/home.vue'], resolve),
  children: [
    { path: '/refresh', component: resolve => require(['./components/refresh.vue'], resolve), name: 'refresh' },
    { path: 'data/list', component: resolve => require(['./components/Administrative/work/data/list.vue'], resolve), name: 'dataList', meta: { hideLeft: false, module: 'Administrative', menu: 'datas' } },
    { path: 'datas/edit/:id', component: resolve => require(['./components/Administrative/work/data/edit.vue'], resolve), name: 'dataEdit', meta: { hideLeft: false, module: 'Administrative', menu: 'datas' } },

    { path: 'report/add', component: resolve => require(['./components/Administrative/work/report/add.vue'], resolve), name: 'reportAdd', meta: { hideLeft: false, module: 'Administrative', menu: 'reports' } },
    { path: 'report/list', component: resolve => require(['./components/Administrative/work/report/list.vue'], resolve), name: 'reportList', meta: { hideLeft: false, module: 'Administrative', menu: 'reports' } },
    { path: 'report/edit/:id', component: resolve => require(['./components/Administrative/work/report/add.vue'], resolve), name: 'reportEdit', meta: { hideLeft: false, module: 'Administrative', menu: 'reports' } },
    { path: 'report/view/:id', component: resolve => require(['./components/Administrative/work/report/add.vue'], resolve), name: 'reportView', meta: { hideLeft: false, module: 'Administrative', menu: 'reports' } },

    { path: 'dashboard/add', component: resolve => require(['./components/Administrative/work/dashboard/add.vue'], resolve), name: 'reportAdd', meta: { hideLeft: false, module: 'Administrative', menu: 'reports' } },
    { path: 'dashboard/list', component: resolve => require(['./components/Administrative/work/dashboard/list.vue'], resolve), name: 'reportList', meta: { hideLeft: false, module: 'Administrative', menu: 'reports' } },
    { path: 'dashboard/edit/:id', component: resolve => require(['./components/Administrative/work/dashboard/add.vue'], resolve), name: 'reportEdit', meta: { hideLeft: false, module: 'Administrative', menu: 'reports' } },
    { path: 'dashboard/view/:id', component: resolve => require(['./components/Administrative/work/dashboard/add.vue'], resolve), name: 'reportView', meta: { hideLeft: false, module: 'Administrative', menu: 'reports' } },

    { path: 'rule/list', component: resolve => require(['./components/Administrative/system/rule/list.vue'], resolve), name: 'ruleList', meta: { hideLeft: false, module: 'Administrative', menu: 'dashboards' } },
    { path: 'rule/add', component: resolve => require(['./components/Administrative/system/rule/add.vue'], resolve), name: 'ruleAdd', meta: { hideLeft: false, module: 'Administrative', menu: 'dashboards' } },
    { path: 'rule/edit/:id', component: resolve => require(['./components/Administrative/system/rule/edit.vue'], resolve), name: 'ruleEdit', meta: { hideLeft: false, module: 'Administrative', menu: 'dashboards' } },
    { path: 'groups/list', component: resolve => require(['./components/Administrative/structures/groups/list.vue'], resolve), name: 'groupsList', meta: { hideLeft: false, module: 'Administrative', menu: 'dashboards' } },
    { path: 'groups/add', component: resolve => require(['./components/Administrative/structures/groups/add.vue'], resolve), name: 'groupsAdd', meta: { hideLeft: false, module: 'Administrative', menu: 'dashboards' } },
    { path: 'groups/edit/:id', component: resolve => require(['./components/Administrative/structures/groups/edit.vue'], resolve), name: 'groupsEdit', meta: { hideLeft: false, module: 'Administrative', menu: 'dashboards' } },
    { path: 'users/list', component: resolve => require(['./components/Administrative/personnel/users/list.vue'], resolve), name: 'usersList', meta: { hideLeft: false, module: 'Administrative', menu: 'dashboards' } },
    { path: 'users/add', component: resolve => require(['./components/Administrative/personnel/users/add.vue'], resolve), name: 'usersAdd', meta: { hideLeft: false, module: 'Administrative', menu: 'dashboards' } },
    { path: 'users/edit/:id', component: resolve => require(['./components/Administrative/personnel/users/edit.vue'], resolve), name: 'usersEdit', meta: { hideLeft: false, module: 'Administrative', menu: 'dashboards' } },
  ]
}, {
  path: '/public',
  component: resolve => require(['./components/public.vue'], resolve),
  children: [
    { path: 'report/view/:id', component: resolve => require(['./components/Administrative/work/report/add.vue'], resolve), name: 'reportShare', meta: { hideLeft: false, module: 'Administrative', menu: 'reports' } },
  ]
}]
export default routes
